package com.tjtt.gwm.webservice.oa;

import java.util.Vector;

import javax.xml.namespace.QName;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class Test1 {

	private String url="http://localhost/TSZ.AssetManageBPM/WebService.asmx";//提供接口的地址
    private String soapaction="http://tempuri.org/";   //域名，这是在server定义的
   
    public Test1()
    {
         
        Service service=new Service();
        try{
            Call call=(Call)service.createCall();            
            call.setTargetEndpointAddress(url);            
            call.setOperationName(new QName(soapaction,"getTemplateFormList")); //设置要调用哪个方法
            call.addParameter(new QName(soapaction,"sysId"), //设置要传递的参数
                    org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
            call.addParameter(new QName(soapaction,"language"), //设置要传递的参数
                    org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
            call.setReturnType(new QName(soapaction,"getTemplateFormList"),String.class); //要返回的数据类型（自定义类型）
           
//          call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);//（标准的类型）
           
            call.setUseSOAPAction(true);
            call.setSOAPActionURI(soapaction + "getTemplateFormList");    
                       
            String v=call.invoke(new Object[]{"",""}).toString();//调用方法并传递参数        
            System.out.println(v);          
           
        }catch(Exception ex)
        {
        	ex.printStackTrace();
        }        
    }
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Test1 t = new Test1();	
	}

}
